import { uploadType, regularRule } from '@/utils/util'
export const baseDataFormConfig = {
	inline: false,
	showBtn: false,
	labelPosition: 'top',
	column: [
		{
			label: 'LOGO',
			prop: 'orgHomeLogo',
			type: 'upload',
			labelPosition: 'top',
			showFileList: false,
			limit: 1,
			multiple: false,
			span: 12,
		},
		{
			label: '营业执照',
			prop: 'orgHomeLicenseImg',
			type: 'upload',
			labelPosition: 'top',
			showFileList: false,
			limit: 1,
			multiple: false,
			changeField: true,
			span: 12,
		},
		{
			label: '名称',
			prop: 'orgHomeName',
			changeField: true,
			type: 'text',
			maxlength: '50',
			showWordLimit: true,
			editDisabled: true,
			span: 8,
		},
		{
			label: '统一社会信用代码',
			prop: 'creditCode',
			changeField: true,
			type: 'text',
			maxlength: '18',
			showWordLimit: true,
			editDisabled: true,
			span: 8,
		},
		{
			label: '机构所属区域',
			prop: 'region',
			propName: 'region_name',
			type: 'AplidAreaSelect',
			changeField: true,
			span: 8,
		},
		{
			label: '机构所在地区',
			prop: 'areas',
			propName: 'areas_name',
			type: 'AplidAreaSelect',
			changeField: true,
			span: 8,
		},
		{
			label: '所在详细地址',
			prop: 'address',
			type: 'text',
			maxlength: '140',
			changeField: true,
			showWordLimit: true,
			span: 8,
		},
		{
			label: '开始运营日期',
			prop: 'operateDate',
			changeField: true,
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		// {
		// 	label: '建立日期',
		// 	prop: 'buildDate',
		// 	changeField: true,
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// },
		// {
		// 	label: '备案日期',
		// 	prop: 'filingDate',
		// 	changeField: true,
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// 	rules: [{ required: true, message: '请选择备案日期' }],
		// },
		{
			label: '组织性质',
			prop: 'orgHomeProperty',
			propName: 'orgHomePropertyLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'LEGAL_PROPERTY',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},

		{
			label: '营业执照是否无限期',
			prop: 'indefinitePeriodFlag',
			propName: 'indefinitePeriodFlagLabel',
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'COMMON_FLAG',
			filterKey: 'value',
			multiple: false,
			changeField: true,
			span: 8,
			rules: [{ required: true, message: '请选择营业执照是否无限期' }],
		},
		{
			label: '营业执照有效起始日期',
			prop: 'licenseStartDate',
			changeField: true,
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		{
			label: '营业执照有效期截止时间',
			prop: 'licenseEndDate',
			changeField: true,
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		// {
		// 	label: '注册类型',
		// 	prop: 'registerType',
		// 	propName: 'registerTypeLabel',
		// 	changeField: true,
		// 	type: 'remoteSelect',
		// 	api: 'getDictItemList',
		// 	code: 'REGISTER_TYPE',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	span: 8,
		// },
		{
			label: '注册资金',
			prop: 'registerAmount',
			changeField: true,
			type: 'input',
			append: '万元',
			span: 8,
		},
		{
			label: '民非组织等级',
			prop: 'organizationLevel',
			propName: 'organizationLevelLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'ORG_LEVEL',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		// {
		// 	label: '评价分',
		// 	prop: 'organizationEvaluateScore',
		// 	type: 'input',
		// 	span: 12,
		// 	rules: [{ pattern: /^[0-9]*$/, message: '请输入正确的评价分' }],
		// },
		{
			label: '运营状态',
			prop: 'operateStatus',
			propName: 'operateStatusLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'ORG_OPERATE_STATUS',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '联系人姓名',
			prop: 'contactUserName',
			type: 'text',
			changeField: true,
			maxlength: '20',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '联系人联系方式',
			prop: 'contactUserPhone',
			type: 'text',
			changeField: true,
			maxlength: '11',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '联系人证件类型',
			prop: 'contactIdentifyType',
			propName: 'contactIdentifyTypeLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'ID_CARD_TYPE',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '联系人证件号码',
			prop: 'contactIdCard',
			type: 'text',
			changeField: true,
			maxlength: '18',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '开户银行',
			prop: 'bankName',
			type: 'text',
			changeField: true,
			maxlength: '50',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '银行账号',
			prop: 'bankAccount',
			type: 'text',
			changeField: true,
			maxlength: '50',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '服务范围',
			prop: 'serviceScope',
			type: 'text',
			changeField: true,
			maxlength: '500',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '是否连锁机构',
			prop: 'isChain',
			propName: 'isChainLabel',
			changeField: false,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'COMMON_FLAG',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '本市运营社区居家服务设施数量',
			prop: 'facilitiesNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '本市运营养老机构数量',
			prop: 'institutionNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '本市运营机构床位数量',
			prop: 'bedNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '外地运营城市数量',
			prop: 'otherCityNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '外地运营社区居家服务设施数量',
			prop: 'otherFacilitiesNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '外地运营养老机构数量',
			prop: 'otherInstitutionNum',
			changeField: false,
			type: 'input',
			append: '个',
			labelPosition: 'top',
			span: 8,
		},
		{
			label: '外地运营机构床位数量',
			prop: 'otherBedNum',
			changeField: false,
			append: '个',
			type: 'input',
			labelPosition: 'top',
			span: 8,
		},
		// {
		// 	label: '注册时间',
		// 	prop: 'registerDate',
		// 	changeField: true,
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// },
		{
			label: '服务组织介绍',
			prop: 'orgHomeIntroduce',
			type: 'textarea',
			maxlength: '1000',
			showWordLimit: true,
			span: 8,
		},
		// 法人信息
		{
			type: 'DividerHtml',
			modelValue: '法人信息',
			span: 24,
		},
		{
			label: '法定代表人姓名',
			prop: 'deputyUserName',
			type: 'text',
			changeField: true,
			maxlength: '20',
			showWordLimit: true,
			span: 8,
			rules: [{ required: true, message: '请输入法定代表人姓名' }],
		},
		{
			label: '法定代表人联系方式',
			prop: 'deputyUserPhone',
			type: 'text',
			changeField: true,
			maxlength: '11',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '法定代表人证件类型',
			prop: 'deputyIdentifyType',
			propName: 'deputyIdentifyTypeLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'ID_CARD_TYPE',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '法定代表人证件号码',
			prop: 'deputyIdentifyCode',
			type: 'text',
			changeField: true,
			maxlength: '18',
			showWordLimit: true,
			span: 8,
		},
		{
			label: '法人登记机关',
			prop: 'registerGovernment',
			type: 'text',
			changeField: true,
			maxlength: '50',
			showWordLimit: true,
			span: 8,
		},
		// {
		// 	label: '法人类型',
		// 	prop: 'deputyType',
		// 	propName: 'deputyTypeLabel',
		// 	changeField: true,
		// 	type: 'remoteSelect',
		// 	api: 'getDictItemList',
		// 	code: 'DEPUTY_TYPE',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	span: 8,
		// },
		{
			label: '法人性质',
			prop: 'deputyProperty',
			propName: 'deputyPropertyLabel',
			changeField: true,
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'LEGAL_PROPERTY',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '法人运营状态',
			prop: 'deputyOperateStatus',
			propName: 'deputyOperateStatusLabel',
			type: 'remoteSelect',
			code: 'ORG_OPERATE_STATUS',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
	],
}
export const ExtendFormConfig = {
	label: '扩展信息',
	prop: 'base1',
	inline: false,
	showBtn: false,
	labelPosition: 'top',
	column: [
		{
			type: 'DividerHtml',
			modelValue: '拓展信息',
			span: 24,
		},
		{
			label: '备案证件照片',
			prop: 'filingIdentifyImg',
			type: 'upload',
			labelPosition: 'top',
			showFileList: false,
			limit: 1,
			multiple: false,
			changeField: true,
			span: 8,
		},
		{
			label: '制度建设文件',
			prop: 'systemBuildFiles',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'top',
			showFileList: true,
			changeField: true,
			limit: 9,
			multiple: true,
			span: 8,
		},
		{
			label: '风险防控措施文件',
			prop: 'riskControlFiles',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'top',
			showFileList: true,
			changeField: true,
			limit: 9,
			multiple: true,
			span: 8,
		},
		{
			label: '评估资质文件',
			prop: 'assessAptitudeFiles',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'top',
			showFileList: true,
			changeField: true,
			limit: 9,
			multiple: true,
			span: 8,
		},
		//--------------------荣誉或奖励 ----------------
		{
			type: 'DividerHtml',
			modelValue: '荣誉或奖励',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamic',
			prop: 'dpServiceOrgHonorList',
			span: 24,
			tabType: 'table',
			custome: 'table',
			column: [
				{
					label: '名称',
					prop: 'honorName',
					maxlength: '50',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '等级',
					prop: 'honorLevelLabel',
					changeField: true,
					type: 'input',
					span: 8,
				},
				{
					label: '取得日期',
					prop: 'getDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
			],
		},
	],
}

export const BaseFormConfig = {
	...baseDataFormConfig,
	column: [...baseDataFormConfig.column],
}

export const detailConfig = {
	inline: false,
	labelPosition: 'left',
	labelWidth: '180px',
	column: [
		{
			prop: 'orgHomeLogo',
			span: 4,
			custome: 'carousel',
			labelPosition: 'top',
			width: '376px',
			props: ['orgHomeLogo', 'orgHomeLicenseImg'],
			style: {
				minWidth: '376px',
				height: '300px',
				borderRadius: '20px 0',
				padding: '10px',
			},
			children: [
				{
					type: 'DividerHtml',
					modelValue: '基本信息',
					position: 'center',
					labelPosition: 'top',
					span: 24,
				},
				{
					label: '民非组织等级',
					prop: 'organizationLevel',
					propName: 'organizationLevelLabel',
					custome: 'RateXing',
					span: 12,
				},
				{
					label: '组织性质',
					prop: 'orgHomePropertyLabel',
					custome: 'tag',
					span: 12,
				},

				{
					label: '法定代表人',
					prop: 'deputyUserName',
					type: 'text',
					span: 12,
				},
				{
					label: '法人联系方式',
					prop: 'deputyUserPhone',
					type: 'text',
					span: 12,
				},
				{
					label: '法人身份证号',
					prop: 'deputyIdentifyCode',
					type: 'text',
					span: 12,
				},

				// {
				// 	label: '建立日期',
				// 	prop: 'buildDate',
				// 	type: 'date',
				// 	format: 'YYYY年MM月DD日',
				// 	valueFormat: 'YYYY-MM-DD',
				// 	span: 12,
				// },
				// {
				// 	label: '备案日期',
				// 	prop: 'filingDate',
				// 	changeField: true,
				// 	type: 'date',
				// 	format: 'YYYY年MM月DD日',
				// 	valueFormat: 'YYYY-MM-DD',
				// 	span: 12,
				// },
				// {
				// 	label: '评价分',
				// 	prop: 'organizationEvaluateScore',
				// 	custome: 'RateXing',
				// 	showXing: false,
				// 	span: 12,
				// },
			],
		},
		{
			label: '所属区域',
			prop: 'region',
			type: 'text',
			span: 8,
		},
		{
			label: '所在地区',
			prop: 'areas',
			type: 'text',
			span: 8,
		},
		{
			label: '所在详细地址',
			prop: 'address',
			type: 'text',
			span: 8,
		},
		{
			label: '联系人',
			prop: 'contactUserName',
			type: 'text',
			span: 8,
		},
		{
			label: '联系方式',
			prop: 'contactUserPhone',
			type: 'text',
			span: 8,
		},
		{
			label: '联系人身份证号',
			prop: 'contactIdCard',
			type: 'text',
			span: 8,
		},
		// {
		// 	label: '法人类型',
		// 	prop: 'deputyTypeLabel',
		// 	type: 'text',
		// 	span: 8,
		// },
		{
			label: '法人性质',
			prop: 'deputyPropertyLabel',
			type: 'text',
			span: 8,
		},
		{
			label: '法人登记机关',
			prop: 'registerGovernment',
			type: 'text',
			span: 8,
		},
		{
			label: '经营范围',
			prop: 'serviceScope',
			type: 'text',
			span: 8,
		},
		{
			label: '营业执照是否无限期',
			prop: 'indefinitePeriodFlagLabel',
			custome: 'tag',
			span: 8,
		},
		{
			label: '营业执照有效起始日期',
			prop: 'licenseStartDate',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		{
			label: '营业执照有效截止时间',
			prop: 'licenseEndDate',
			labelWidth: '260px',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		// {
		// 	label: '注册类型',
		// 	prop: 'registerTypeLabel',
		// 	custome: 'tag',
		// 	span: 8,
		// },
		{
			label: '注册资金（万元）',
			prop: 'registerAmount',
			type: 'text',
			append: '万元',
			span: 8,
		},
		// {
		// 	label: '注册时间',
		// 	prop: 'registerDate',
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// },
		{
			label: '开户银行',
			prop: 'bankName',
			type: 'text',
			span: 8,
		},
		{
			label: '银行账号',
			prop: 'bankAccount',
			type: 'text',
			span: 8,
		},

		{
			label: '服务组织介绍',
			prop: 'orgHomeIntroduce',
			type: 'text',
			showWordLimit: true,
			span: 24,
		},
	],
}
